package com.xxh.dataaccess.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxh.dataaccess.dao.UserMessageDao;
import com.xxh.dataaccess.dto.message.LikeMessageDto;
import com.xxh.dataaccess.dto.message.ReplyMessageDto;
import com.xxh.dataaccess.entity.UserMessage;
import com.xxh.dataaccess.service.UserMessageService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (UserMessage)表服务实现类
 *
 * @author makejava
 * @since 2021-03-12 15:12:38
 */
@Service("userMessageService")
public class UserMessageServiceImpl extends ServiceImpl<UserMessageDao, UserMessage> implements UserMessageService {


    @Override
    public List<UserMessage> getSysMessageByUid(Integer uid) {

        List<UserMessage> list = baseMapper.selectList(new QueryWrapper<UserMessage>()
                .eq("to_user_id", uid).eq("from_user_id", 0));
        return list;
    }


    @Override
    public List<LikeMessageDto> getLikeMessageByUid(Integer uid) {
        return null;
    }


    @Override
    public List<ReplyMessageDto> getUserReplyMessage(Integer uid) {

        return baseMapper.getUserReplayMessageByUid(uid);
    }
}
